﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;

namespace KimPhongCRM.Lib
{
    public static class convertParameters
    {
        public static Dictionary<string, object> parameter(string str)
        {
            Dictionary<string, object> routeValues = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(str);
            return routeValues;
        }

        public static List<object> listparameter(string str)
        {
            List<object> routeValues = new JavaScriptSerializer().Deserialize<List<object>>(str);
            return routeValues;
        }

        public static string strparameter(Dictionary<string, object> dic)
        {
            string strParameter = new JavaScriptSerializer().Serialize(dic);
            return strParameter;
        }
    }
}